<!-- 
 Copyright 2009 University of  Washington
This code is released under the GPL version 3 - with a copy of the license included
@author Maya Hao Li
 -->
<%@ page contentType="text/html; charset=ISO-8859-1" language="java"%>
<%@ page import="seedpod.model.custom.SeedpodUser"%>
<%@ page import="seedpod.webapp.LimsSession"%>
<%@ page import="seedpod.webapp.view.Page"%>

<%
	Page spPage = new Page();
	spPage.addJsLibrary( "/javascript/lib/scriptaculous/src/effects.js"	);
	spPage.addJsLibrary("/javascript/lib/scriptaculous/src/scriptaculous.js");
	SeedpodUser user = LimsSession.getSession( request ).getUser();
	out.println( spPage.getPageOpenHtml() );
	out.println( spPage.getBanner( user ) );

// SeedpodUser user = LimsSession.getSession( request ).getUser();
String clsName = (String)request.getParameter("clsName"); 
if (clsName == null )
	clsName = "";
%>

<script type="text/JavaScript">

function loadClsViewXML() {
	new Ajax.Request('../lims/clsViewer',
		{
			method:'post',
			parameters: {clsName: $F('clsName') },
			onSuccess: function(transport) {
	   		 	var clsView = $('clsViewer');
	   		 	var response = transport.responseText;
	   		 	clsView.update(response);
			},
			
			onFailure: function() {
				clsView.update('Sorry, no cls definition found or service is not available.');
			}
		});
}

</script>

<div id="container">
<div id="content">
<div id="clsViewerBox" class="alertBox">
	<form id="clsViewRequestForm" method="get" action="" onSubmit="return false;">
	<table><tr><td>	<input type="text" id="clsName" value="<%=clsName%>"> </td><td>
		<input type="submit" id="btn_clsview" class="button" value="view class definition" 
			onclick="loadClsViewXML()"></td></tr>
	</table></form></div>


<a href="#" onclick="Effect.toggle('clsViewer','slide'); return false;">Toggle Class Definition </a>
<!-- <div id="d1" style="display:none;">-->

<div id="clsViewer" style="background-color:#ddeeff;border:2px solid gray;padding:10px; width:100%;">
	<script> this.onload=loadClsViewXML()</script>
</div>

<!-- </div> -->

<!-- end content div --></div>
<!--  end container div --></div>
<% out.println(spPage.getFooter()); %>
